﻿using System;
using System.Linq;
using DevExpress.Web.ASPxMenu;

namespace INSTA.MusiqueStore.UI.Web1
{
    public partial class Master : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var l = DAL.CustomMusiqueStoreEntities.GetGenres();
            foreach (var i in l.Select(genre => new MenuItem()
                                                    {
                                                        Text = genre.Nom,
                                                        NavigateUrl = "~/DisplayGenres.aspx?i=" + genre.Id
                                                    }))
            {
                ASPxMenu1.Items.FindByName("MenuGenres").Items.Add(i);
            }
        }

        protected void btnChercher_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            Response.Redirect("~/Search.aspx?s=" + txtRecherche.Text);
        }


    }
}